﻿using UnityEngine;
using System.Collections;

namespace Room
{
    public class RCUIUnionActor : RCUIPlayer
    {
        float arriveRange = 0f;
        public RCUIUnionActor(RoomCharactor owner):
            base(owner)
        {
            type = UIType.UnionActor;
            ClickRange = (float) Dict.DictDataManager.Instance.tableGameConfigureDao.currentData.UnionFightCanClickResRange;
            arriveRange = (float)Dict.DictDataManager.Instance.tableGameConfigureDao.currentData.UnionFightArriveOther;
        }

        protected override void OnClick()
        {
            var self = owner.charactorManager.GetSelfCharactor();
            var ai = self.ai as RCAIUnionSelf;
            if (ai != null)
            {
                ai.AutoGoto(owner.transform.position, () => { }, arriveRange );
            }
        }
    }
}